<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<link rel="stylesheet" href="static/ace/css/bootstrap.css" />
<link rel="stylesheet" href="static/ace/css/font-awesome.css" />
<!-- text fonts -->
<link rel="stylesheet" href="static/ace/css/ace-fonts.css" />
<!-- ace styles -->
<link rel="stylesheet" href="static/ace/css/ace.css"
	class="ace-main-stylesheet" id="main-ace-style" />
<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
	<script type="text/javascript">
	$(top.hangge());
	
</script>
</head>
<body class="no-skin">
	
	<div class="main-container" id="main-container">
		
		<div class="main-content">
			<div class="main-content-inner">
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
								<form  id="shipinformationForm" method="post">
									<div id="zhongxin" style="padding-top: 13px;">
									<table id="table_report" class="table table-striped table-bordered table-hover">
									<tr>
									 <td style="width:79px;text-align: right;padding-top: 13px;">运输工具类型:</td>
									 <td>
										<select name="VEHICLE_TYPE" title="运输工具类型" maxlength="32" style="width:98%;">
										<option value="">全部</option>
										<option value="0" <c:if test="${pd.VEHICLE_TYPE == '0' }">selected</c:if>>水运</option>
										<option value="1" <c:if test="${pd.VEHICLE_TYPE == '1' }">selected</c:if>>空运</option>
										<option value="2" <c:if test="${pd.VEHICLE_TYPE == '2' }">selected</c:if>>陆运</option>
										<option value="3" <c:if test="${pd.VEHICLE_TYPE == '3' }">selected</c:if>>铁运</option>
										</select>
									</td>
									 <td style="width:79px;text-align: right;padding-top: 13px;">排序ID:</td>
									 <td><input type="text" name="SOTR_ID"  value="${pd.SOTR_ID }"  maxlength="32" placeholder="这里输入排序ID" title="排序ID"  style="width:98%;" /></td>
								   </tr>
								   <tr>
									 <td style="width:79px;text-align: right;padding-top: 13px;">挂港:</td>
									 <td><input type="text" name="CALL_PORT"  value="${pd.CALL_PORT }" maxlength="32" placeholder="这里输入挂港" title="挂港" style="width:98%;" /></td>
									 <td style="width:79px;text-align: right;padding-top: 13px;">船名:</td>
									 
									 <td id="js">
										<select name="SHIP_NAME_ID" id="SHIP_NAME_ID" title="船名" maxlength="32" style="width:98%;">
										<option value="">全部</option>
										<c:forEach items="${list}" var="sh">
										
							          <option value="${sh.ID}"
							          <c:if test="${sh.ID==pd.SHIP_NAME_ID}">selected</c:if>>${sh.SHIP_NAME }</option>
							         
						</c:forEach>
						
										</select>
									</td>
								   </tr>
									<tr>
									 <td style="width:79px;text-align: right;padding-top: 13px;">航次:</td>
									 <td><input type="text" name="VOYAGE_NUMBER" id="VOYAGE_NUMBER" value="${pd.VOYAGE_NUMBER }"  maxlength="32" placeholder="这里输入航次" title="航次"  style="width:98%;" /></td>
									 <td style="width:79px;text-align: right;padding-top: 13px;">航线:</td>
									 <td>
										<select name="ROUTE_ID"  title="航线" maxlength="32" style="width:98%;">
										<option value="">全部</option>
										<c:forEach items="${list1}" var="sh">
							            <option value="${sh.ID}"
							           <c:if test="${sh.ID==pd.ROUTE_ID}">selected</c:if>>${sh.ROUTE_NAME }</option>
						</c:forEach>
										</select>
									</td>
								   </tr>	
									<tr>
<!-- 									 <td style="width:79px;text-align: right;padding-top: 13px;">承运人:</td> -->
<%-- 									 <td><input type="text" name="CARRIER" value="${pd.CARRIER }"  maxlength="32" placeholder="这里输入承运人" title="承运人" style="width:98%;" /></td> --%>
									 <td style="width:79px;text-align: right;padding-top: 13px;">承运人:</td>
									 
									 <td id="jj">
										<select name="CARRIER" id="CARRIER" title="承运人" maxlength="32" style="width:98%;">
										<option value="">全部</option>
										<c:forEach items="${list}" var="ship">
										
							          <option value="${ship.ID}@${ship.SETTLE_UNIT}"
							          <c:if test="${ship.ID==pd.CARRIER_ID}">selected</c:if>>${ship.SETTLE_UNIT }</option>
							         
						</c:forEach>
						
										</select>
									</td>
									 <td style="width:79px;text-align: right;padding-top: 13px;">重量:</td>
									 <td><input type="text" name="WEIGHT"  value="${pd.WEIGHT }" maxlength="32" placeholder="这里输入重量" title="重量" style="width:98%;" /></td>
								   </tr>	
									
								  <tr>
								   <td style="width:79px;text-align: right;padding-top: 13px;">载重箱量:</td>
									 <td><input type="text" name="PALOAD_VOLUME"  value="${pd.PALOAD_VOLUME }"  maxlength="32" placeholder="这里输入载重箱量" title="载重箱量"  style="width:98%;" /></td>
									<td style="width:79px;text-align: right;padding-top: 13px;">载空箱量:</td>
									<td><input type="text" name="EMPTY_CAPACITY"  value="${pd.EMPTY_CAPACITY }"  maxlength="32" placeholder="这里输入载空箱量" title="载空箱量"  style="width:98%;" /></td>	
								  </tr>
								    <tr>
								   <td style="width:79px;text-align: right;padding-top: 13px;">是否可以计费:</td>
									<td>
										<select name="IS_BILLING" title="是否可以计费" maxlength="32" style="width:98%;">
										<option value="">全部</option>									
										<option value="1" <c:if test="${pd.IS_BILLING=='1'}">selected</c:if>>是</option>
										<option value="0" <c:if test="${pd.IS_BILLING=='0'}">selected</c:if>>否</option>
										
										</select>
									</td>
									 <td style="width:79px;text-align: right;padding-top: 13px;">是否满7天录入:</td>
									<td>
										<select name="IS_SEVEN_DAYS" title="是否满7天录入" maxlength="32" style="width:98%;">
										<option value="">全部</option>										
										<option value="1" <c:if test="${pd.IS_SEVEN_DAYS=='1'}">selected</c:if>>是</option>
										<option value="0" <c:if test="${pd.IS_SEVEN_DAYS=='0'}">selected</c:if>>否</option>
										
										</select>
									</td>
								  </tr>
								  <tr>
								  <td style="width:79px;text-align: right;padding-top: 13px;">计划开航时间:</td>
									<td><input type="date" name="SCHEDULED_SAILING_TIME"  value="${pd.SCHEDULED_SAILING_TIME }"   maxlength="32" placeholder="这里输入计划开航时间" title="计划开航时间"  style="width:98%;height:30px;" /></td>
									<td style="width:79px;text-align: right;padding-top: 13px;">计划到达时间:</td>
									<td><input type="date" name="PLANNED_ARRIVAL_TIME"  value="${pd.PLANNED_ARRIVAL_TIME }"  maxlength="32" placeholder="这里输入计划到达时间" title="计划到达时间"  style="width:98%;height:30px;" /></td>
									
								  </tr>
								    <tr>
								    <td style="width:79px;text-align: right;padding-top: 13px;">起始地:</td>
									<td><input type="text" name="STARTING_PLACE" value="${pd.STARTING_PLACE }"  maxlength="32" placeholder="这里输入起始地" title="起始地"  style="width:98%;" /></td>
									<td style="width:79px;text-align: right;padding-top: 13px;">目的地:</td>
									<td><input type="text" name="DESTINATION" value="${pd.DESTINATION }"   maxlength="32" placeholder="这里输入目的地" title="目的地"  style="width:98%;" /></td>
									
								  </tr>
								  <tr>
									 <td style="width:79px;text-align: right;padding-top: 13px;">吃水:</td>
									 <td><input type="text" name="DRAFT"  value="${pd.DRAFT }"  maxlength="32" placeholder="这里输入吃水" title="吃水"  style="width:98%;" /></td>
									
											<td style="width:79px;text-align: right;padding-top: 13px;">卸货完成时间:</td>
											<td><input type="date" name="SHIP_COMPLETION_TIME"  value="${pd.SHIP_COMPLETION_TIME }"  placeholder="这里输入实际江船开航时间" maxlength="64" title="实际江船开航时间" style="width:98%;height:30px;"/></td>
										
								   </tr>
								  <tr>
											<td style="width:79px;text-align: right;padding-top: 13px;">实际江船开航时间:</td>
											<td><input type="date" name="ACTUAL_SAILING_TIME_VESSEL"  value="${pd.ACTUAL_SAILING_TIME_VESSEL }" placeholder="这里输入实际江船开航时间" maxlength="64" title="实际江船开航时间" style="width:98%;height:30px;"/></td>
											<td style="width:79px;text-align: right;padding-top: 13px;">实际江船到达时间:</td>
											<td><input type="date" name="ACTUAL_ARRIVED_TIME"  value="${pd.ACTUAL_ARRIVED_TIME }" placeholder="这里输入实际江船到达时间" maxlength="64" title="实际江船到达时间" style="width:98%;height:30px;"/></td>
										</tr>	
										 	
										<tr>
											<td style="text-align: center;" colspan="10">
												<a class="btn btn-mini btn-primary" onclick="save('${pd.ID}');">保存</a>
												<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
											</td>
										</tr>
									</table>
									</div>
									<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green"></h4></div>
								</form>
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->
	</div>
	
</body> 
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script type="text/javascript">
	function save(ID){	
		if($("#SHIP_NAME_ID").val()==""){
			$("#js").tips({
				side:3,
	            msg:'请选择船名',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#role_id").focus();
			return false;
		}
		if($("#VOYAGE_NUMBER").val()==""){
			$("#VOYAGE_NUMBER").tips({
				side:3,
	            msg:'请输入航次',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#VOYAGE_NUMBER").focus();
			return false;
			
		}
		if($("#CARRIER").val()==""){
			$("#jj").tips({
				side:3,
	            msg:'请选择承运人',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#CARRIER").focus();
			return false;
		}
		$.ajax({
			type:"post",
			url:'<%=basePath%>ship/saveU?ID='+ ID,
			data:$("#shipinformationForm").serialize(),
			dataType:"text",
			success:function(data){
				top.Dialog.close()
				window.location.reload();	
			}
			
		})
		
	}
</script>
</html>